import tkinter as tk
import tkinter.ttk as ttk
from .page_settings_input import PageSettingsInput
from .page_settings_output import PageSettingsOutput
from .page_settings_link import PageSettingsIO


class PageSettings(ttk.Frame):
    def __init__(self, parent):
        super().__init__(parent)
        self.link_settings = PageSettingsIO(self)
        self.output_settings = PageSettingsOutput(self)
        self.input_settings = PageSettingsInput(self)

    def init_ui(self, controller):
        self.link_settings.init_ui(controller)
        self.link_settings.grid(row=0, column=0, sticky="nsew")
        self.output_settings.grid(row=1, column=0, sticky="nsew")
        spacer = ttk.Label(self)
        spacer.grid(row=2, column=0, sticky="nsew")
        self.input_settings.grid(row=3, column=0, sticky="nsew")

        self.grid_columnconfigure(0, weight=1)
        self.grid_rowconfigure(0, weight=0)
        self.grid_rowconfigure(1, weight=0)
        self.grid_rowconfigure(2, weight=1)
        self.grid_rowconfigure(3, weight=0)
